<?php
//* Tham Made Contry Day 28/12 */

class Country{
    const TABLE_NAME = 'travel_state';
    /**
     * @param string $sState
     * @param int $idCountry
     */
    public static function getStates($sState, $idCountry){
	global $wpdb;
	$sql =  'SELECT * FROM '.Country::TABLE_NAME.' WHERE `country_id`='.$idCountry.' AND (`name` LIKE "'.$sState.'%"
			OR `name` LIKE  "%'.$sState.'" OR `name` LIKE "%'.$sState.'%") LIMIT 5';
	$data = $wpdb->get_results($sql);
	return $data;
    }
	
    public static function listCountry(){
	return array(
	    'USA' => 'USA',
	    'India' => 'India',
	    'Arab' => 'Arab'
	);
    }
}
